package com.nulgame.bukkit.plugin.messagebuilder;

import junit.framework.TestCase;

import com.nulgame.bukkit.plugin.responsebuilder.AntiServerAddressResponseBuilder;

public class AntiServerAddressResponseBuilderTestCase extends TestCase {
	public void testToResponse(){
		AntiServerAddressResponseBuilder builder = new AntiServerAddressResponseBuilder("A server address is not allowed", "chicanh", "chicanh.com is my server", "chicanh.com");
		assertEquals("A server address is not allowed", builder.toResponse());
		
		builder = new AntiServerAddressResponseBuilder("%PlayerName%, A server address %ServerAddress% is not allowed, your chat is %Message%", "chicanh", "chicanh.com is my server", "chicanh.com");
		assertEquals("chicanh, A server address chicanh.com is not allowed, your chat is chicanh.com is my server", builder.toResponse());
		
		builder = new AntiServerAddressResponseBuilder(null, "chicanh", "chicanh.com is my server", "chicanh.com");
		assertNull(builder.toResponse());
	}
}
